package com.smh.demo1.a06;

import org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor;
import org.springframework.context.annotation.CommonAnnotationBeanPostProcessor;
import org.springframework.context.annotation.ConfigurationClassPostProcessor;
import org.springframework.context.support.GenericApplicationContext;

/**
 * @author shiminghui
 * @date 2025/4/12 9:51
 * @description: TODO
 */
public class A06Application {
    public static void main(String[] args) {

        GenericApplicationContext context = new GenericApplicationContext();
        context.registerBean(AutowiredAnnotationBeanPostProcessor.class); // 注册一个注解处理器 处理autowire,valued注解
        context.registerBean(CommonAnnotationBeanPostProcessor.class); // 注册一个注解处理器 处理resource,postConstruct,preDestroy注解
        context.registerBean(ConfigurationClassPostProcessor.class); // 注册一个注解处理器 处理Configuration, ComponentScan, Bean 注解

//        context.registerBean("bean1", Bean1.class);
//        context.registerBean("config",Config.class);
        context.registerBean("config2", Config2.class);

        context.refresh();

        context.close();

    }


}
